package com.service;
import java.util.List;
import com.model.Chengji;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.Map;
import com.mapper.ChengjiMapper;
@Service
public class ChengjiServiceImpl implements ChengjiService
{
        
        @Autowired
	private ChengjiMapper chengjiMapper;


	public List<Chengji> queryChengjiList(Chengji chengji) throws Exception {
		Map<String, Object> map = new HashMap<String, Object>();
		if(chengji!=null){
			map.put("cid", chengji.getCid());
			map.put("sid", chengji.getSid());
		}
		List<Chengji> getChengji = chengjiMapper.query(map);
		return getChengji;
	}

	public int insertChengji(Chengji chengji) throws Exception {
		
		return chengjiMapper.insertChengji(chengji);
	}

	public int deleteChengji(int id) throws Exception {
		return chengjiMapper.deleteChengji(id);
	}

	public int updateChengji(Chengji chengji) throws Exception {
		return chengjiMapper.updateChengji(chengji);
	}
	
	public Chengji queryChengjiById(int id) throws Exception {
		return chengjiMapper.queryChengjiById(id);
	}
	public List report(int cid) throws Exception {
		return chengjiMapper.report(cid);
	}
	
	public List banjiChengji(int banji) throws Exception {
		return chengjiMapper.banjiChengji(banji);
	}
}
